<!--#include file="pjson.asp"-->
<!DOCTYPE html>
<html>
<head>
  <title>表管理</title>
<%easp.include "h.asp"%>
</head>
<body>
  <div class="layui-fluid">
    <div class="layui-card">
<blockquote class="layui-elem-quote layui-quote-nm">
	<button class="layui-btn layuiadmin-btn-useradmin" lay-submit lay-filter="t_ret">
	 <i class="layui-icon layui-icon-return layuiadmin-button-btn"></i>
	 </button>
	<%
	if val("sszid")="" then
		echo "当前为新增受试者"
	else
		echo "当前受试者编号：" & val("sszid")
	end if	
	%> 
</blockquote>   
<%
input_h "sszid"
input_h "un"
%>     
      <div class="layui-form layui-card-header layuiadmin-card-header-auto">
		<div class="layui-form-item">
          <div class="layui-inline">
              <input type="text" name="tn" class="layui-input">
          </div>
	  
          <div class="layui-inline">
            <button class="layui-btn layuiadmin-btn-useradmin" lay-submit lay-filter="t_search">
              <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
            </button>
          </div>
        </div>
      </div>

      <div class="layui-card-body">
		<script type="text/html" id="barDemo">
			<a class="layui-btn layui-btn-xs" lay-event="t_edit2">开始填写</a>
		</script>
		<table id="t" lay-filter="t"></table>
			<br>
      </div>
    </div>
  </div>
  <script src="/dzps/src/layuiadmin/layui/layui.js"></script>  
  <script>
  layui.config({
    base: '/dzps/src/layuiadmin/' //静态资源所在路径
  }).extend({
    index: 'lib/index' //主入口模块
  }).use(['index', 'useradmin', 'table'], function(){
    var $ = layui.$
    ,form = layui.form
    ,admin = layui.admin	
    ,table = layui.table;
    form.render();
	table.render({
        elem: '#t',
        url: layui.setter.base + 'lib/reg.asp?action=t_list&prj_id=<%=val("prj_id")%>',
        cols: [[
        {field: 'id',title: 'ID',width: 60,sort: true,hide:true},
        <%g_tbf "tn:150,prn:0,f1:0","表名,所属项目,物理表名"%>
        {fixed: 'right',width: 90,align: 'center',toolbar: '#barDemo'}]],
        id: 't',limit: 10,page: true,height: 475
    });
	
	table.on('tool(t)',
    function(obj) {
        var data = obj.data;
		var sszid=$("input[name='sszid']").val();
		var un=$("input[name='un']").val();
		if (obj.event === 't_edit2'){
			location.href = 't_show.asp?now=' + new Date().getTime()+"&id="+data.id+"&tn="+data.tn+"&prn="+data.prn+"&ssbh="+sszid+"&name="+un+"&wlbm="+data.f1+"&prj_id="+data.prj_id;
		}
	});	
	form.on('submit(t_ret)',function(data){
		location.href = "javascript:history.back();" 
	})	
  });
  </script>
</body>
</html>